int main(string []args)
{
    var sf = new MTBLib.ShuffleStack(32);
    var arr = new int[32];
    int top = 0;
    print("Stage 0: Check whether empty() and full() works\n");
    print("empty() = %sempty\n", sf.empty() ? "": "not ");
    print("full()  = %sfull\n", sf.full() ? "": "not ");

    print("\nStage 1: Just draw and do nothing else\n");
    for (int i = 0; i < 32; i++)
        print(@"$(sf.draw_lazy())\t");

    print("\n\nStage 2: Shuffle for several times\n");
    for (int i = 0; i < 10; i++) {
        arr[top] = sf.draw();
        print("%4d ", arr[top]);
        top++;
    }
    print("\nempty() = %sempty\n", sf.empty() ? "": "not ");
    print("full()  = %sfull\n", sf.full() ? "": "not ");
    for (int i = 0; i < 22; i++) {
        arr[top] = sf.draw();
        print("%4d ", arr[top]);
        top++;
    }
    print("\nempty() = %sempty\n", sf.empty() ? "": "not ");
    print("full()  = %sfull\n", sf.full() ? "": "not ");
    foreach (var i in sf.id_buff) {
        print("%4d ", i);
    }

    print("\n\nStage 3: Undo for several times\n");
    for (int i = 0; i < 10; i++) {
        sf.undo();
    }
    print("\nempty() = %sempty\n", sf.empty() ? "": "not ");
    print("full()  = %sfull\n", sf.full() ? "": "not ");
    for (int i = 0; i < 22; i++) {
        sf.undo();
    }
    print("\nempty() = %sempty\n", sf.empty() ? "": "not ");
    print("full()  = %sfull\n", sf.full() ? "": "not ");
    print("sf.buff = {");
    foreach (var i in sf.id_buff) {
        print("%4d ", i);
    }
    print("}\n");

    return 0;
}
